{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#Referência: http://sebastianraschka.com/Articles/2015_singlelayer_neurons.html\n",
    "class Perceptron(object):\n",
    "    \n",
    "    def __init__(self, eta=0.01, epochs=50):\n",
    "        self.eta = eta #taxa de aprendizado\n",
    "        self.epochs = epochs #número de iterações para determinar o vetor de pesos (w)\n",
    "    \n",
    "    def net_input(self, X):\n",
    "        return np.dot(X, self.w_[1:]) + self.w_[0] #Produto vetorial + bias\n",
    "    \n",
    "    def train(self, X, y):\n",
    "\n",
    "        self.w_ = np.zeros(1 + X.shape[1]) # Cria vetor de pesos com n linhas (conforme coluna de X) + 1 (para bias)\n",
    "        self.errors_ = []\n",
    "\n",
    "        for _ in range(self.epochs):\n",
    "            errors = 0\n",
    "            for xi, target in zip(X, y):\n",
    "                \n",
    "                #Função de custo e atualização dos pesos\n",
    "                #thetaX = taxa_atualizacao * (targe - predicted) * inputX\n",
    "                                \n",
    "                update = self.eta * (target - self.predict(xi)) #decide para onde o vetor de pesos irá girar\n",
    "                # Repare que se for predito corretamente, o resultado do update será zero, \n",
    "                # logo o peso não será alterado\n",
    "                self.w_[1:] +=  update * xi #aqui decide o quanto irá girar                    \n",
    "                self.w_[0] +=  update #peso theta0 não possui variavel atrelada, logo + update, apenas\n",
    "                \n",
    "                errors += int(update != 0.0)\n",
    "            self.errors_.append(errors)\n",
    "        return self\n",
    "    \n",
    "    def predict(self, X):\n",
    "        return np.where(self.net_input(X) >= 0.0, 1, -1) # Aplica a função de ativação (step_function)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def plot_decision_regions(X, y, clf, res=0.02):\n",
    "    \"\"\"\n",
    "    Plots decision regions of a classifier.\n",
    "    \n",
    "    Parameters\n",
    "    ----------\n",
    "    X : array-like, shape = [n_samples, n_features]\n",
    "      Feature Matrix.\n",
    "      \n",
    "    y : array-like, shape = [n_samples]\n",
    "      True class labels.\n",
    "    \n",
    "    clf : Classifier object. Must have a .predict method.\n",
    "        \n",
    "    res : float (default: 0.02)\n",
    "      Grid width. Lower values increase the resolution but\n",
    "        slow down the plotting.\n",
    "        \n",
    "    Returns\n",
    "    ---------\n",
    "    None\n",
    "\n",
    "    \"\"\"\n",
    "    x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1\n",
    "    y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1\n",
    "    xx, yy = np.meshgrid(np.arange(x_min, x_max, res),\n",
    "                         np.arange(y_min, y_max, res))\n",
    "    \n",
    "    Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])\n",
    "    Z = Z.reshape(xx.shape)\n",
    "    plt.contourf(xx, yy, Z, alpha=0.4)\n",
    "    plt.scatter(X[:, 0], X[:, 1], c=y,  alpha=0.8)\n",
    "    \n",
    "    plt.xlim(xx.min(), xx.max())\n",
    "    plt.ylim(yy.min(), yy.max())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Weights: [-0.4  -0.68  1.82]\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXYAAAEZCAYAAACD/A7qAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3Xd8VFX6+PHPc2cyaRACoYTeCR2kWEBBcFXsYsXexXXX\nsmvZte7q7v5c9qu76rp2QWwgoqhUEdcVBEQQCL33EkggCUlmksnMPb8/ZhJCSBkIkzJ53q+XLzIz\n9577zGz2yZlzz3mOGGNQSikVO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Ltpmbhv4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f2cff1cd0d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.read_csv('iris.data', header=None)\n",
    "\n",
    "# obtem a classe das 100 primeiras linhas\n",
    "y = df.iloc[0:100, 4].values\n",
    "# transforma o vetor, que antes possuia cada valor de classe, em outro vetor com -1 e 1, onde -1 é Iris-setosa e\n",
    "# 1 qualquer outra classe\n",
    "y = np.where(y == 'Iris-setosa', -1, 1)\n",
    "\n",
    "# obtem as features sepal length and petal length das 100 primeiras linhas\n",
    "X = df.iloc[0:100, [0,2]].values\n",
    "\n",
    "\n",
    "ppn = Perceptron(epochs=10, eta=0.1)\n",
    "\n",
    "ppn.train(X, y)\n",
    "print('Weights: %s' % ppn.w_)\n",
    "plot_decision_regions(X, y, clf=ppn)\n",
    "plt.title('Perceptron')\n",
    "plt.xlabel('sepal length [cm]')\n",
    "plt.ylabel('petal length [cm]')\n",
    "plt.show()\n",
    "\n",
    "# plt.plot(range(1, len(ppn.errors_)+1), ppn.errors_, marker='o')\n",
    "# plt.xlabel('Iterations')\n",
    "# plt.ylabel('Missclassifications')\n",
    "# plt.show()\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
